Skip to content

Commit 8204e0c

Browse files
authored
Update outbox macro (#5970)
* Update outbox macro
1 parent dfac0c2 commit 8204e0c

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

kitsune/messages/jinja2/messages/includes/macros.html

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -52,27 +52,27 @@
5252

5353
{% macro outbox_message(message) -%}
5454
<span class="to">
55-
{% if message.recipient %}
55+
{% if message.recipients_count > 0 %}
5656
<p><strong>{{ _('To') }}:</strong>
57-
{% if message.recipients > 1 -%}
58-
{% set comma = joiner(', ') %}
59-
{% for user in message.to.all() -%}
60-
{{ comma() }}
61-
{{ name_link(user) }}
62-
{%- endfor %}
63-
{% else %}
64-
{{ name_link(message.recipient) }}
65-
{% endif %}
57+
{% set comma = joiner(', ') %}
58+
{% for user in message.to.all() -%}
59+
{{ comma() }}
60+
{{ name_link(user) }}
61+
{% else %}
62+
{{ name_link(message.recipient) }}
63+
{% endfor %}
6664
</p>
6765
{% endif %}
6866
</span>
69-
{% if in_staff_group(request.user) and message.to_group %}
67+
{% if in_staff_group(request.user) and message.to_groups_count > 0 %}
7068
<span class="to-group">
7169
<p><strong>{{ _('To Groups') }}:</strong>
7270
{% set comma = joiner(', ') %}
73-
{% for group in message.to_group.all() -%}
74-
{{ comma() }}
75-
{{ group_link(group) }}
71+
{% for group in message.to_groups -%}
72+
{%- for profile in group.profile.all() -%}
73+
{{ comma() }}
74+
<a href="{{ url('groups.profile', profile.slug) }}">{{ group }}</a>
75+
{% endfor %}
7676
{% endfor %}
7777
</p>
7878
</span>

0 commit comments

Comments
 (0)